package logic

import (
	"context"
	"errors"
	"medi-manage/models"

	"medi-manage/medirpc/internal/svc"
	"medi-manage/medirpc/medirpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type MediDetailLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewMediDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MediDetailLogic {
	return &MediDetailLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 详情
func (l *MediDetailLogic) MediDetail(in *medirpc.MediDetailRequest) (*medirpc.MediDetailResponse, error) {
	// todo: add your logic here and delete this line
	var medi models.Medi
	err := medi.MediGroupById(models.DB, in.MeidId)
	if err != nil {
		return nil, errors.New("医生不存在，查询失败")
	}
	return &medirpc.MediDetailResponse{}, nil
}
